﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加报表</title>
<base href="<%=request.getContextPath()%>/"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style/adminStyle.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" src="ckeditor/ckeditor.js"></script>
</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="user"></i><em>添加新闻</em></span>
    <span class="modular fr"><a href="news/list" class="pt-link-btn">返回新闻列表</a></span>
  </div>

  <form:form action="news/update" method="post" modelAttribute="news"  enctype="multipart/form-data">
  <table class="noborder">
  <tr>
	    <td>
	    	<input type="hidden" name="newsId" value="${news.newsId}" class="textBox length-middle"/>
	    </td>
   </tr>
   <tr>
	    <td style="width:15%;text-align:right;">新闻标题：</td>
	    <td>
	    	<input type="text" value="${news.newsTitle}" name="newsTitle" class="textBox length-middle"/>
	    </td>
   </tr>
    <tr>
    	<td style="width:15%;text-align:right;">新闻类型：</td>
    	<td>
    	<select name="type.typeId" class="textBox length-middle">
	    	<c:forEach items="${list}" var="type">
	    		<c:choose>
	    			<c:when test="${type.typeId==news.type.typeId}">
	    				<option selected="selected" value="${type.typeId}">${type.typeName}</option>
	    			</c:when>
	    			<c:otherwise>
	    				<option value="${type.typeId}">${type.typeName}</option>
	    			</c:otherwise>
	    		</c:choose>
	    	</c:forEach>
     	</select>
    	</td>
   </tr>
   <tr>
   		<td style="width:15%;text-align:right;">新闻内容</td>
   		<td style="width:85%;"><form:textarea path="newsContext"  cssClass="ckeditor"/></td>
  		
   </tr>
    <tr>
	    <td style="width:15%;text-align:right;">新闻图片：</td>
	    <td><input name="file" type="file" /></td>
   </tr>
   
   <tr>
	    <td style="width:15%;text-align:right;">创建人：</td>
	    <td><input value="${news.creator}" type="text" readonly="readonly" name="creator" class="textBox length-middle"/></td>
   		<td style="width:15%;text-align:right;">发布时间：</td>
	    <td><input type="datetime" value='<fmt:formatDate value="${news.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>'  readonly="readonly" name="createTime" class="textBox length-middle"/></td>
   </tr>
    
   <tr>
	    <td style="width:15%;text-align:right;">修改人：</td>
	    <td><input type="text" readonly="readonly" name="updator" class="textBox length-middle"/></td>
   		<td style="width:15%;text-align:right;">修改时间：</td>
	    <td><input type="datetime" value='<fmt:formatDate value="${news.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>' readonly="readonly" name="updateTime" class="textBox length-middle"/></td>
   </tr>
  
   <tr>
	    <td style="width:15%;text-align:right;"></td>
	    <td>
	     	<input type="submit" value="确认" class="tdBtn"/>
	    </td>
   </tr>
  </table>
  </form:form>
  
 </div>
</body>
</html>
<script type="text/javascript">
CKEDITOR.replace('newsContext', {
	"filebrowserUploadUrl" : "<%=request.getContextPath()%>/upload"
	});
</script>